<!--
/**
* Author: linchun
* Date: 2022-07-30 14:53
* Desc: 区域块 BlockArea 
*/
-->
<template>
  <view
    class="block-area"
    :class="{ customClass: true, active: isActived }"
    @click="$emit('myTap')"
  >
    <text class="key onShow">{{ info[blockKey] || errorTip }}</text>
  </view>
</template>

<script>
  export default {
    name: 'BlockArea',
    data() {
      return {}
    },
    props: {
      info: {
        type: Object,
        default: () => {
          return {}
        }
      },
      errorTip: String,
      blockKey: String,
      customClass: String,
      isActived: Boolean
    },
    created() {},
    methods: {
      // 初始化方法
      init() {}
    }
  }
</script>
<style lang="scss" scoped>
  .block-area {
    width: 170rpx;
    padding: 0 15rpx;
    height: 56rpx;
    line-height: 56rpx;
    border: 2rpx solid #dcdcdc;
    border-radius: 6rpx;
    // margin-bottom: 25rpx;
    text-align: center;
    // margin-right: 20rpx;
    .key {
      display: inline-block;
      width: 170rpx;
      font-size: 28rpx;
      color: #999999;
    }
    &.active {
      background: rgba(59, 197, 210, 0.08);
      border: 2rpx solid #3bc5d2;
      .key {
        color: #3bc5d2;
      }
    }
  }
</style>
